import { Button, Checkbox, Form, Input } from 'antd'
import React from 'react'

export default function Ant() {
    let [form] = Form.useForm()
    let getvalue = ()=>{
       console.log(form.getFieldsValue());
       
    }
  return (
    <Form
    form={form}
    name="basic"
    labelCol={{ span: 3 }}
    wrapperCol={{ span: 5 }}
    initialValues={{ remember: true }}
    autoComplete="off"
    onFinish={getvalue}
  >
    <Form.Item
      label="账号"
      name="username"
      rules={[{ required: true, message: 'Please input your username!' }]}
    >
      <Input />
    </Form.Item>

    <Form.Item
      label="密码"
      name="password"
      rules={[{ required: true, message: 'Please input your password!' }]}
    >
      <Input.Password />
    </Form.Item>

    <Form.Item name="remember" valuePropName="checked" wrapperCol={{ offset: 2, span: 3 }}>
      <Checkbox>记住密码</Checkbox>
    </Form.Item>

    <Form.Item wrapperCol={{ offset: 2, span: 3 }}>
      <Button type="primary" htmlType="submit">
        提交
      </Button>
    </Form.Item>
  </Form>
  )
}
